package org.example.microservice.sys.model.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 建表语句：
 * CREATE TABLE `sys_department` (
 *   `id` varchar(60) NOT NULL COMMENT '部门id',
 *   `name` varchar(128) NOT NULL COMMENT '部门名称',
 *   `sort_number` int(11) DEFAULT '0' COMMENT '显示的顺序',
 *   `remark` varchar(512) DEFAULT NULL COMMENT '备注说明',
 *   `create_user` varchar(40) DEFAULT NULL COMMENT '创建人',
 *   `create_time` datetime DEFAULT NULL COMMENT '创建时间',
 *   PRIMARY KEY (`id`)
 * ) COMMENT='部门信息表';
 */
@Data
@TableName("sys_department")
@ApiModel(value = "部门信息")
public class Department implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("部门id")
    @TableId(value = "id", type = IdType.INPUT)
    private String id;

    @ApiModelProperty("部门名称")
    @TableField("name")
    private String name;

    @ApiModelProperty("显示顺序")
    @TableField("sort_number")
    private Integer sortNumber;

    @ApiModelProperty("备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty("创建人")
    @TableField("create_user")
    private String createUser;

    @ApiModelProperty("创建时间")
    @TableField("create_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}
